#include <algorithm>
#include <iostream>
#include <memory>
using std::cout;
using std::endl;
using std::unique_ptr;


void test(){
    unique_ptr<int> up(new int(10));
    //unique_ptr禁止拷贝复制
    //unique_ptr<int> up2(up);
    unique_ptr<int> up3(std::move(up));
    cout << up3.get() << endl;
    cout << *up3 << endl;
    cout << up.get()<<endl;
    //cout << *up << endl; //移动拷贝后，up3没有托管权
}

int main()
{
    test ();
    return 0;
}

